package com.sa.web.behind.action;

import java.util.List;

import net.sf.json.JSONArray;

import com.opensymphony.xwork2.ActionSupport;
import com.sa.web.bean.EstBean;
import com.sa.web.dao.service.EstDao;
import com.sa.web.util.Page;
import com.sa.web.util.Util;

public class EstManageAction extends ActionSupport {
	/** 序列 */
	private static final long serialVersionUID = 1L;
	/** 用户信息dao*/
	private EstDao estDao;
	/** 用户信息bean*/		
	private EstBean estBean;
	/** 设置管理员信息集合 */
	List<EstBean> estList;
	/** easyUi对象*/
	private JSONArray rows;
	/** 信息总数*/
	private JSONArray total;
	/** 获取返回值*/
	private JSONArray msg;
	
	private String id;
	
   /**
    * 初始化管理员查询页面
    * @return success
    * @throws Exception
    */
	public String initEstFind() throws Exception {
		return SUCCESS;
	}
	/**
	 * 查找管理员信息
	 * @return json
	 * @throws Exception
	 */
	public String findEstList()  throws Exception{
		 estList = estDao.getEstList(Page.getStarIndex(),Page.getPreIndex());
		 rows = JSONArray.fromObject(estList);
		 total = JSONArray.fromObject(estDao.getEstCount());
		 return Util.jSONSuccess();
	}
	
		public String findEst()  throws Exception{
		estBean = estDao.getEstById(id);
		 return "findEst";
	}
	
	
/**************************getter and setter****************************************************************************************************/
	
	public EstDao getEstDao() {
		return estDao;
	}

	public void setEstDao(EstDao estDao) {
		this.estDao = estDao;
	}

	public EstBean getEstBean() {
		return estBean;
	}

	public void setEstBean(EstBean estBean) {
		this.estBean = estBean;
	}

	public List<EstBean> getEstList() {
		return estList;
	}

	public void setEstList(List<EstBean> estList) {
		this.estList = estList;
	}

	public JSONArray getTotal() {
		return total;
	}

	public void setTotal(JSONArray total) {
		this.total = total;
	}

	public JSONArray getRows() {
		return rows;
	}

	public JSONArray getMsg() {
		return msg;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
}
